package com.cp.dao;

import com.cp.repository.ClassRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassRelationMapper {

    @Select("SELECT * FROM class_relation WHERE id = #{id}")
    @Results({
            @Result(id = true, property = "id", column = "id"),
            @Result(property = "content", column = "content")
    })
    ClassRelation getById(Integer id);

	@Select("SELECT * FROM class_relation ORDER BY id ASC")
	@Results({
			@Result(id = true, property = "id", column = "id"),
			@Result(property = "content", column = "content")
	})
    List<ClassRelation> getAll();

}
